<?php

/**
 * O2O团购PC版本
 * ============================================================================
 * * 版权所有 2009-2016 郑州司科计算机科技有限公司，并保留所有权利。
 * 购买网址: http://www.jzphp.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
  * 咨询电话：400-823-0371 QQ：313999875
 * ============================================================================
 * $Author: zzsike $
 * $Time 2016-02-03 sammy $
*/


require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_auth('market');

$condition = array();

/* filter */
/* filter end */

$count = Table::Count('adinfo', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$ads = DB::LimitQuery('adinfo', array(
	'condition' => $condition,
	'order' => 'ORDER BY type DESC, available DESC,displayorder DESC,id DESC',
	'size' => $pagesize,
	'offset' => $offset,
));

$pagetypes = array('header'=>'页面顶部','footer'=>'页脚','sidetop'=>'右侧栏顶部','sidebottom'=>'右侧栏底部',);
$availables = array('1'=>'是','0'=>'否');

include template("manage_market_ad");

function current_market_ad($s=null) {
	$filter = array(
		'ad' => '广告列表',
		'adedit' => '添加广告',
	);
	$a['/manage/market/ad.php'] = '广告列表';
	foreach($filter AS $id=>$name) {
		$a["/manage/market/{$id}.php"] = $name;
	}
	$l = '/manage/market/ad.php';
	if ($s) $l = "/manage/market/{$s}.php";
	return current_link($l, $a, true);
}
